﻿namespace TelecoSystems.Web.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data.Objects.DataClasses;
    using System.Linq;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;

    // The MetadataTypeAttribute identifies ContractMetadata as the class
    // that carries additional metadata for the Contract class.
    [MetadataTypeAttribute(typeof(Contract.ContractMetadata))]
    public partial class Contract
    {

        // This class allows you to attach custom attributes to properties
        // of the Contract class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ContractMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private ContractMetadata()
            {
            }

            public Customer Customer { get; set; }

            [Required]
            public int CustomerID { get; set; }

            [Editable(false)]
            [Display(Name = "Created", Description = "Date when the record was created.")]
            public DateTime DateCreated { get; set; }

            [Editable(false)]
            [Display(Name = "Modified", Description = "Date of the last modification.")]
            public DateTime DateLastModified { get; set; }
            
            [Editable(false)]
            public Guid DealerID { get; set; }

            [Required]
            public int EditionID { get; set; }

            [Editable(false)]
            public int Id { get; set; }

            public EntityCollection<Incident> Incidents { get; set; }

            public Variant Variant { get; set; }
        }
    }
}
